package com.professordelphi.locadora;

import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionListener;
import java.sql.Connection;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class TelaFunc extends EventoFunc implements ActionListener{
	
	JButton btincluir,btexcluir,btatualizar,btnovo,btlocalizar,btrelatorio;
	JLabel lbcodfunc,lbnomefunc,lbtelfunc,lbcpffunc,lbcelfunc,lbendfunc;
	JTextField txtnomefunc,txtcodfunc,txttelfunc,txtcelfunc,txtcpffunc,txtendfunc;
	JPanel p1;
	public Connection con;
	
	
	

	public TelaFunc() {
		btincluir=new JButton("incluir");
		btincluir.addActionListener(this);
		btincluir.setForeground(Color.red);
		btincluir.setBorder(BorderFactory.createLineBorder(Color.red,2));
		btexcluir=new JButton("excluir");
		btexcluir.addActionListener(this);
		btexcluir.setForeground(Color.red);
		btexcluir.setBorder(BorderFactory.createLineBorder(Color.red,2));
		btatualizar=new JButton("atualizar");
		btatualizar.addActionListener(this);
		btatualizar.setForeground(Color.red);
		btatualizar.setBorder(BorderFactory.createLineBorder(Color.red,2));
		btnovo=new JButton("novo");
		btnovo.addActionListener(this);
		btnovo.setForeground(Color.red);
		btnovo.setBorder(BorderFactory.createLineBorder(Color.red,2));
		btlocalizar=new JButton("localizar");
		btlocalizar.addActionListener(this);
		btlocalizar.setForeground(Color.red);
		btlocalizar.setBorder(BorderFactory.createLineBorder(Color.red,2));
		btrelatorio=new JButton("relatorio");
		btrelatorio.addActionListener(this);
		btrelatorio.setForeground(Color.red);
		btrelatorio.setBorder(BorderFactory.createLineBorder(Color.red,2));
		
		lbcodfunc=new JLabel("codigo");
		lbcodfunc.setFont(new Font("arial",Font.BOLD,18));
		lbcodfunc.setForeground(Color.blue);
		//lbcodfunc.setBorder(BorderFactory.createLineBorder(Color.red,2));
		lbnomefunc=new JLabel("nome");
		lbnomefunc.setFont(new Font("arial",Font.BOLD,18));
		lbnomefunc.setForeground(Color.blue);
		//lbnomefunc.setBorder(BorderFactory.createLineBorder(Color.red,2));
		lbendfunc=new JLabel("endereco");
		lbendfunc.setFont(new Font("arial",Font.BOLD,18));
		lbendfunc.setForeground(Color.blue);
		//lbendfunc.setBorder(BorderFactory.createLineBorder(Color.red,2));
		lbtelfunc=new JLabel("telefone");
		lbtelfunc.setFont(new Font("arial",Font.BOLD,18));
		lbtelfunc.setForeground(Color.blue);
		//lbtelfunc.setBorder(BorderFactory.createLineBorder(Color.red,2));
		lbcelfunc=new JLabel("celular");
		lbcelfunc.setFont(new Font("arial",Font.BOLD,18));
		lbcelfunc.setForeground(Color.blue);
		//lbcelfunc.setBorder(BorderFactory.createLineBorder(Color.red,2));
		lbcpffunc=new JLabel("cpf");
		lbcpffunc.setFont(new Font("arial",Font.BOLD,18));
		lbcpffunc.setForeground(Color.blue);
		//lbcpffunc.setBorder(BorderFactory.createLineBorder(Color.white,2));
		
		txtcodfunc=new JTextField();
		txtcodfunc.setFont(new Font("Arial",Font.BOLD,12));
		txtcodfunc.setBorder(BorderFactory.createLineBorder(Color.blue,2));
		txtcodfunc.setEditable(false);
		txtcodfunc.setFont(new Font("Arial",Font.BOLD,12));
		txtcodfunc.setForeground(Color.blue);
		txtcodfunc.setBackground(Color.yellow);
		txtnomefunc=new JTextField();
		txtnomefunc.setBorder(BorderFactory.createLineBorder(Color.blue,2));
		txtnomefunc.setFont(new Font("Arial",Font.BOLD,12));
		txtnomefunc.setForeground(Color.blue);
		txtnomefunc.setBackground(Color.yellow);
		txtendfunc=new JTextField();
		txtendfunc.setBorder(BorderFactory.createLineBorder(Color.blue,2));
		txtendfunc.setFont(new Font("Arial",Font.BOLD,12));
		txtendfunc.setForeground(Color.blue);
		txtendfunc.setBackground(Color.yellow);
		txttelfunc=new JTextField();
		txttelfunc.setBorder(BorderFactory.createLineBorder(Color.blue,2));
		txttelfunc.setFont(new Font("Arial",Font.BOLD,12));
		txttelfunc.setForeground(Color.blue);
		txttelfunc.setBackground(Color.white);
		txtcelfunc=new JTextField();
		txtcelfunc.setBorder(BorderFactory.createLineBorder(Color.blue,2));
		txtcelfunc.setFont(new Font("Arial",Font.BOLD,12));
		txtcelfunc.setForeground(Color.blue);
		txtcelfunc.setBackground(Color.white);
		txtcpffunc=new JTextField();
		txtcpffunc.setBorder(BorderFactory.createLineBorder(Color.blue,2));
		txtcpffunc.setFont(new Font("Arial",Font.BOLD,12));
		txtcpffunc.setForeground(Color.blue);
		txtcpffunc.setBackground(Color.white);
		
		p1=new JPanel();
		p1.setBackground(Color.green);
		
		
		p1.add(lbcodfunc);
		lbcodfunc.setBounds(10,20,60,30);
		p1.add(txtcodfunc);
		txtcodfunc.setBounds(100,20,170,30);
		p1.add(lbnomefunc);
		lbnomefunc.setBounds(10,60,60,30);
		p1.add(txtnomefunc);
		txtnomefunc.setBounds(100,60,170,30);
		p1.add(lbendfunc);
		lbendfunc.setBounds(10,100,100,30);
		p1.add(txtendfunc);
		txtendfunc.setBounds(100,100,170,30);
		p1.add(lbtelfunc);
		lbtelfunc.setBounds(10,140,140,30);
		p1.add(txttelfunc);
		txttelfunc.setBounds(100,140,170,30);
		p1.add(lbcelfunc);
		lbcelfunc.setBounds(10,180,180,30);
		p1.add(txtcelfunc);
		txtcelfunc.setBounds(100,180,170,30);
		p1.add(lbcpffunc);
		lbcpffunc.setBounds(10,220,220,30);
		p1.add(txtcpffunc);
		txtcpffunc.setBounds(100,220,170,30);
		p1.add(btincluir);
		btincluir.setBounds(280,20,100,30);
		p1.add(btexcluir);
		btexcluir.setBounds(280,180,100,30);
		p1.add(btatualizar);
		btatualizar.setBounds(280,100,100,30);
		p1.add(btrelatorio);
		btrelatorio.setBounds(280,140,100,30);
		p1.add(btlocalizar);
		btlocalizar.setBounds(280,60,100,30);
		p1.add(btnovo);
		btnovo.setBounds(280,220,100,30);
		
		btincluir.setEnabled(true);
		btexcluir.setEnabled(false);
		btatualizar.setEnabled(false);
		btnovo.setEnabled(true);
		btrelatorio.setEnabled(true);
		btlocalizar.setEnabled(true);
		
		getContentPane().add(p1);
		setSize(400,300);
		setTitle("cadastro funcionario");
		
		//p1.setLayout(new GridLayout(10,2));
		
		p1.setLayout(null);
		
		
	}
		
		
		
		
	
	public static void main(String[] args) {
		

	}

}
